/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2022 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32g4xx_hal.h"

#include "stm32g4xx_ll_adc.h"
#include "stm32g4xx_ll_cordic.h"
#include "stm32g4xx_ll_dma.h"
#include "stm32g4xx_ll_opamp.h"
#include "stm32g4xx_ll_rcc.h"
#include "stm32g4xx_ll_bus.h"
#include "stm32g4xx_ll_crs.h"
#include "stm32g4xx_ll_system.h"
#include "stm32g4xx_ll_exti.h"
#include "stm32g4xx_ll_cortex.h"
#include "stm32g4xx_ll_utils.h"
#include "stm32g4xx_ll_pwr.h"
#include "stm32g4xx_ll_spi.h"
#include "stm32g4xx_ll_tim.h"
#include "stm32g4xx_ll_usart.h"
#include "stm32g4xx_ll_gpio.h"
#include "stm32g4xx_ll_I2C.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stm32g4xx_ll_cordic.h"

/* Device */
#include "IIC_Device.h"
#include "CAN_Device.h"
#include "Analog_Sensor.h"
#include "ElectronicBrake.h"
#include "WS2812.h"

/* INC */
#include "MintaProtocol.h"
#include "Version.h"
#include "api.h"
/* motor control */
#include "foc.h"
#include "foc_task.h"
#include "IC_MU.h"
#include "DriverPara.h"
#include "Encoder.h"
#include "calibration.h"
#include "structs.h"
#include "pid.h"
#include "trajectory.h"
#include "mc_err.h"

/* C lib*/
#include "tgmath.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
/* utils math */
#include "utils_math.h"
// Debug 
#include "Vofa.h"
//Jlink EventRecorder Debug
//#include "EventRecorderConf.h"
//#include "EventRecorder.h"
//JScope
#include "SEGGER_RTT.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define SPI4_CS_Pin LL_GPIO_PIN_4
#define SPI4_CS_GPIO_Port GPIOE
#define I2C3_SCL_Pin LL_GPIO_PIN_8
#define I2C3_SCL_GPIO_Port GPIOC
#define I2C3_SDA_Pin LL_GPIO_PIN_9
#define I2C3_SDA_GPIO_Port GPIOC
#define I2C1_SCL_Pin LL_GPIO_PIN_15
#define I2C1_SCL_GPIO_Port GPIOA
#define SPI1_CS_Pin LL_GPIO_PIN_6
#define SPI1_CS_GPIO_Port GPIOB
#define I2C1_SDA_Pin LL_GPIO_PIN_7
#define I2C1_SDA_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */
#define SPI1_CS_Pin LL_GPIO_PIN_6
#define SPI1_CS_GPIO_Port GPIOB
//debug
#define BRAKE_Pin LL_GPIO_PIN_8
#define BRAKE_Port GPIOA
#define TP2_Pin LL_GPIO_PIN_12
#define TP2_Port GPIOA
#define TP3_Pin LL_GPIO_PIN_13
#define TP3_Port GPIOB
#define TP4_Pin LL_GPIO_PIN_15
#define TP4_Port GPIOB


/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
